import apiUrl from '../base'
import axios from '@/libs/axios'
const TemporaryFacility = {
  findList(data) {
    return axios.request({
      url: `${apiUrl.base}v1/OverlayFacilities/list`,
      data,
      method: 'post'
    })
  },
  findProList(data) {
    //获取项目信息
    return axios.request({
      url: `${apiUrl.base}v1/Project/getAll`,
      data,
      method: 'post'
    })
  },
  getDetail(id) {
    //获取详情
    return axios.request({
      url: `${apiUrl.base}v1/OverlayFacilities/detail/${id}`,
      method: 'get'
    })
  },
  add(data) {
    return axios.request({
      url: `${apiUrl.base}v1/OverlayFacilities/add`,
      data,
      method: 'post'
    })
  },
  edit(data) {
    return axios.request({
      url: `${apiUrl.base}v1/OverlayFacilities/edit`,
      data,
      method: 'post'
    })
  },
  //导入
  getProfessionalTypeImportExcel(data) {
    return axios.post(`${apiUrl.base}v1/OverlayFacilities/importExcel`, data)
  },
  //错误数据再次保存
  getProfessionalTypeimportObject(data) {
    return axios.post(`${apiUrl.base}v1/OverlayFacilities/importObject`, data)
  },
  //delete
  getProfessionalTypeDelete(data) {
    return axios.post(`${apiUrl.base}v1/OverlayFacilities/batchDelete`, data)
  },
  findCode(id) {
    return axios.request({
      url: `${apiUrl.base}v1/OverlayFacilities/generateCodeByProjectId/${id}`,
      method: 'get'
    })
  },
  getUserDefaultProject() {
    return axios.request({
      url: `${apiUrl.base}v1/Project/getUserDefaultProject`,
      method: 'get'
    })
  }
}
export default TemporaryFacility
